package javaEEBasic.day02;

import java.util.Scanner;

public class Test01 {
    public static void main(String[] args) {
        //test01();
//        test02();
//        test03();
//        test05();
//        test06();
        test08();
        //test09();
       // test10();
    }


    public static void test01() {
        //算术运算符测试
        //+号可以做连接符 能算则算，不能算则连在一起
        int a = 5;
        System.out.println("abc" + 5);
        System.out.println(5 + a); // 10
        System.out.println('a' + a); //102
        System.out.println('a' + a + "itheima"); //102itheima
        System.out.println(5 / 2); //2
        System.out.println(5.0 / 2);  //2.5
        System.out.println(5 % 2);
        System.out.println(5.0 % 2);
    }

    public static void test02() {
        int a = 10;
        int b = 5;
        int rs = ++a; // 11
        int rs1 = b++; // rs1 = 5, b = 6
        System.out.println("a:" + a);
        System.out.println("b:" + b);
        System.out.println("rs:" + rs);
        System.out.println("rs1:" + rs1);
        System.out.println("===========================");
        int c = 2;
        int d = 3;
        System.out.println(c & d); //逐位与运算 //2
        System.out.println(c | d); //逐位或运算 //3
        System.out.println(c ^ d);  // 逐位异或运算 ,同0 异1 //1
        //System.out.println( (c>d) && 1); //报错 运算符 '&&' 不能应用于 'boolean'、'int'
        // 短路与和短路或 ，两侧必须是ture或false
        System.out.println((c > d) && (a++ < b)); //前面已经为true，后面不执行
        System.out.println("a:" + a);
        System.out.println((c > d) || (a < b));
        //System.out.println( a && b); //报错 运算符 '&&' 不能应用于 'int'、'int'
    }

    public static void test03() {
        //运算符优先级顺序
        int a = 3;
        int b = 6;
        System.out.println(b > a || b > a && b < a); //true
        //&& 优先级大于 ||
        System.out.println(b > a || b++ > a && b < a);
        System.out.println(b);
    }

    public static void test04() {
        int studentNum = 100;
        double price = 55.55;
        Long earthAge = 4600000000L;
        boolean result = false;
        System.out.println(studentNum);
        System.out.println(price);
        System.out.println(earthAge);
        System.out.println(result);
    }

    public static void test05() {
        double priceA = 24;
        double priceB = 8;
        double priceC = 2;
        double priceA1 = 16;
        double initPrice = priceA1 + priceB + priceC;
        double initPrice1 = priceA1 + priceB + priceC;
        double minMoney = 0;
        minMoney = Math.min(initPrice > 30 ? initPrice * 0.8 : initPrice, initPrice1);
        System.out.println(minMoney);
    }

    public static void test06() {
        double priceA = 24;
        double priceB = 8;
        double priceC = 2;
        double discount = 0.8;
        double initResult = priceA + priceB + priceC;
        double result1 = initResult * discount;
        double result2 = initResult > 30 ? initResult - 15 : initResult;
        System.out.println(Math.min(result1, result2));
        System.out.println(0.1 + 0.2);
    }

    public static void test07() {
        Scanner sc = new Scanner(System.in);
        int score = sc.nextInt();
        if (score >= 90) {
            System.out.println("优秀");
        } else if (score >= 60 && score < 90) {
            System.out.println("一般");
        } else if (score >= 0 && score < 60) {
            System.out.println("不及格");
        } else {
            System.out.println("输入分数不符合格式要求");
        }
    }

    public static void test08() {
        Scanner sc = new Scanner(System.in);
        int weekNum = sc.nextInt();
        switch (weekNum) {
            case 1:
                System.out.println("星期一");
                ;
            case 2:
                System.out.println("星期二");
                ;
            case 3:
                System.out.println("星期三");
                break;
            case 4:
                System.out.println("星期四");
                break;
            case 5:
                System.out.println("星期五");
                break;
            case 6:
                System.out.println("星期六");
                break;
            case 7:
                System.out.println("星期日");
                break;
            default:
                System.out.println("输入错误");
        }
    }

    public static void test09() {
        for (int i = 1; i <= 100; i++) {
            if (i % 2 == 0) {
                System.out.println(i);
            }
        }
    }

    public static void test10() {
        int count = 0;
        int a = 2, b = 4, c = 6, d = 8;
        if (a < 5) {
            count++;
        }
        if (b < 5) {
            count++;
        }
        if (c < 5) count++;
        if (d < 5) count++;
        System.out.println(count);

    }


}
